Subroutine to calculate the coordinates of the units inside a kohonen layer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | current_index |
Integer variables |
||
integer, | intent(in) | :: | ix |
Integer variables |
||
integer, | intent(in) | :: | iy |
Integer variables |
||
integer, | intent(in) | :: | iz |
Integer variables |
||
integer, | intent(in) | :: | nx |
Integer variables |
||
integer, | intent(in) | :: | ny |
Integer variables |
||
integer, | intent(in) | :: | nz |
Integer variables |
||
real(kind=wp), | intent(out), | dimension(:,:) | :: | coordinates |
Real array |
|
character(len=*), | intent(in) | :: | node_type |
Character variable |
subroutine calculate_coordinates(current_index,ix,iy,iz,nx,ny,nz,coordinates,node_type) !======================================================================================== !! Subroutine to calculate the coordinates of the units inside a kohonen layer integer,intent(in) :: current_index,ix,iy,iz,nx,ny,nz !! Integer variables real(kind=wp),dimension(:,:),intent(out) :: coordinates !! Real array character(len=*),intent(in) :: node_type !! Character variable coordinates(current_index,1)=dble(ix); coordinates(current_index,2)=dble(iy); coordinates(current_index,3)=dble(iz); if(trim(node_type) .eq. 'hexagonal') then coordinates(current_index,1)=coordinates(current_index,1)+& .5_wp*(mod(coordinates(current_index,2),2.0_wp)); coordinates(current_index,2)=(dsqrt(3.0_wp)/2._wp)*coordinates(current_index,2); endif ! end subroutine calculate_coordinates